$OpenBSD: patch-spooler_DAgent_cpp,v 1.31 2016/09/04 14:52:38 robert Exp $
--- spooler/DAgent.cpp.orig	Mon Jul 18 23:19:27 2016
+++ spooler/DAgent.cpp	Mon Aug  8 09:18:50 2016
@@ -69,6 +69,11 @@
 #include <pwd.h>
 #endif
 
+#ifdef __OpenBSD__
+#include <sys/resource.h>
+extern char **environ;
+#endif
+
 #include "spmain.h"
 #include "TmpPath.h"
 
@@ -1727,12 +1732,18 @@ static HRESULT SendOutOfOffice(LPADRBOOK lpAdrBook, LP
 	}
 
 	{
+#ifndef __OpenBSD__
 		locale_t timelocale = createlocale(LC_TIME, "C");
+#endif
 		time_t now = time(NULL);
 		tm local;
 		localtime_r(&now, &local);
+#ifndef __OpenBSD__
 		strftime_l(szHeader, PATH_MAX, "\nDate: %a, %d %b %Y %T %z", &local, timelocale);
 		freelocale(timelocale);
+#else
+		strftime(szHeader, PATH_MAX, "\nDate: %a, %d %b %Y %T %z", &local);
+#endif
 	}
 
 	if (WriteOrLogError(fd, szHeader, strlen(szHeader)) != hrSuccess) {
@@ -3990,7 +4001,7 @@ int main(int argc, char *argv[]) {
 
 	DeliveryArgs sDeliveryArgs;
 	sDeliveryArgs.strPath = "";
-	sDeliveryArgs.strAutorespond = "/usr/sbin/zarafa-autorespond";
+	sDeliveryArgs.strAutorespond = "${PREFIX}/sbin/zarafa-autorespond";
 	sDeliveryArgs.bCreateFolder = false;
 	sDeliveryArgs.strDeliveryFolder.clear();
 	sDeliveryArgs.szPathSeperator = '\\';
@@ -4046,8 +4057,8 @@ int main(int argc, char *argv[]) {
 		{ "server_bind", "" },
 		{ "server_bind_intf", "" },
 #ifdef LINUX
-		{ "run_as_user", "zarafa" },
-		{ "run_as_group", "zarafa" },
+		{ "run_as_user", "_zarafa" },
+		{ "run_as_group", "_zarafa" },
 		{ "pid_file", "/var/run/zarafad/dagent.pid" },
 		{ "coredump_enabled", "no" },
 #endif
@@ -4067,11 +4078,11 @@ int main(int argc, char *argv[]) {
 		{ "log_raw_message", "no", CONFIGSETTING_RELOADABLE },
 		{ "log_raw_message_path", "/tmp", CONFIGSETTING_RELOADABLE },
 		{ "archive_on_delivery", "no", CONFIGSETTING_RELOADABLE },
-		{ "mr_autoaccepter", "/usr/sbin/zarafa-mr-accept", CONFIGSETTING_RELOADABLE },
-		{ "mr_autoprocessor", "/usr/sbin/zarafa-mr-process", CONFIGSETTING_RELOADABLE },
+		{ "mr_autoaccepter", "${PREFIX}/sbin/zarafa-mr-accept", CONFIGSETTING_RELOADABLE },
+		{ "mr_autoprocessor", "${PREFIX}/sbin/zarafa-mr-process", CONFIGSETTING_RELOADABLE },
 		{ "plugin_enabled", "yes" },
-		{ "plugin_path", "/var/lib/zarafa/dagent/plugins" },
-		{ "plugin_manager_path", "/usr/share/zarafa-dagent/python" },
+		{ "plugin_path", "${LOCALSTATEDIR}/db/zarafa/dagent/plugins" },
+		{ "plugin_manager_path", "${PREFIX}/share/zarafa-dagent/python" },
 		{ "default_charset", "iso-8859-15" },
 		{ "set_rule_headers", "yes", CONFIGSETTING_RELOADABLE },
 		{ "no_double_forward", "no", CONFIGSETTING_RELOADABLE },
